home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44d.zip / SIZE19.QM < prev    next >
Text File  |  1992-04-26  |  14KB  |  241 lines

  1. *                               SIZE19.QM
  2. *                   Macros To Show Byte Size of Macros
  3. *                        Written by Tom Hogshead
  4. *                 With Macro Contributions by Fred Drake
  5. *                                4/23/92
  6. *--                                                          BYTES
  7. * @(3) Size of SINGLE Macro In Short Format:                  223         |NEW
  8. *
  9. * 223 bytes  4/22/92  11:38 pm (TH @3)
  10. *
  11. *--
  12. * @(1) Size of SINGLE Macro In Format:                        146         |chg
  13. *
  14. * 146 bytes Wed  04-22-1992  23:31:51 (TH @1)
  15. *
  16. *--
  17. * @(2)Size of ALL Macros In File In Format:                   147         |chg
  18. *
  19. * 147 bytes Wed  04-22-1992  23:34:18 (TH @2)
  20. *
  21. *--eoi
  22.  
  23. * DESCRIPTION: SIZE19.QM macros insert a macro's byte size at end of macro.
  24.  
  25. * NOTES: a) QEdit and QMAC v2.15 are required.
  26. *        b) Remove "SetScreenOff" if not using QEdit v2.15.
  27. *        c) Volume label must not contain ASCII #237 "φ".
  28. *        d) Temporary files "c:#", "c:#.φ" and "c:¡" are created/deleted.
  29. *        e) Change c:\ to a ramdisk for faster operation.  Mine is c:\.
  30. *        f) Macros have been tested only with DOS 3.3.  Others should be Ok.
  31. *        g) Macro must be a paragraph with NO blank lines.
  32. *        h) QSIZ.BAT and QMAC.EXE must be in path.
  33. *        i) Word "macro_begin" (no _) must be used only at start of macro.
  34. *        j) Key and "macro_begin"  must be on same line.
  35. *        k) I am not affiliated with SemWare.
  36.  
  37. *   ┌───  This QSIZ.BAT batch file must be in the path  ───┐
  38. *   │@echo off                                             │
  39. *   │:qsiz.bat          October 17, 1991                   │
  40. *   │        cls                                           │
  41. *   │        echo Converts "c:#" (text) to "c:#.φ" (binary)│
  42. *   │        if not exist   c:# goto NOTEXIST              │
  43. *   │        QMAC c:#.φ     c:#   /B /A-                   │
  44. *   │        dir  c:#.φ>c:¡                                │
  45. *   │        del  c:#                                      │
  46. *   │        del  c:#.φ                                    │
  47. *   │        exit                                          │
  48. *   │:NOTEXIST                                             │
  49. *   │        echo c:# does not exist                      │<-last char ^P^G
  50. *   └──────────────────────────────────────────────────────┘
  51.  
  52. *                            M A C R O S
  53. * ----------------------------------------------------------------------
  54. * @(1) Macro to Show Byte Size of SINGLE Macro
  55. *      Written by Tom Hogshead and Fred Drake
  56. * ----------------------------------------------------------------------
  57. *   This macro inserts macro byte size of a SINGLE macro at the end of
  58. *   the macro as shown below.  Place cursor line anywhere in a txtfile
  59. *   macro and press @1.
  60.  
  61. @1  macrobegin setscreenoff onewindow endline
  62.     setwordwrapmode togglewordwrap                                         *|
  63.     find "macro" "begin" return "BI" return     * Find start of macro
  64.     jfalse END                                  * End if no macro
  65.     splitline endline unmarkblock markcharacter * Mark key                 *|
  66.     prevposition joinline begline               *  "    "                  *|
  67.     storescrbuff "7" return                     * Store <key> to buff 7
  68.     endpara markline                            * Mark macro               *|
  69.     writeblock "c:#" return                     * Write macro block to c:# *|
  70.     "o" backspace                               * In case c:# exists       *|
  71.     dos "qsiz" return return                    * Make macfile Dir list c:¡
  72.     editfile backspace #173 return quit         * Quit c:¡
  73.     gotoblockend                                * Ensure correct ring pos
  74.     editfile return                             * Load macfile Dir list
  75.     find #237 return delline return jfalse END  * Pos cursor on macfile ext
  76.     wordright markword                          * Mark size
  77.     storescrbuff "8" return                     * Store size to buff 8
  78.     killfile quit                               * Kill/quit c:¡            *|
  79.     addline begline                             * Add size line to macro   *|
  80.     "*" cursorright getscrbuff "8" return       * Insert byte size
  81.     endline cursorright "bytes"
  82.     cursorright insertdate inserttime           * Date stamp
  83.     "(TH "                                      * Change to your initials
  84.     getscrbuff "7" return gotoblockend          * Insert key
  85.     endline jtrue END                           * Test if Enter Matching On
  86.     ")" cursorleft                              *ELSE Insert ")"  if not On
  87.   END: togglewordwrap unmarkblock                                          *|
  88. *
  89. * 189 bytes Thu  09-13-1990  19:13:24
  90. * 199 bytes Thu  05-16-1991  11:32:44 (TH added author ID)
  91. * 209 bytes Mon  07-01-1991  15:01:30 (TH @1, added macro <key>)
  92. * 202 bytes Thu  10-03-1991  22:55:03 (TH @1, shortened, #3/708)
  93. * 204 bytes Sat  10-05-1991  19:12:57 (TH @1, for all DOS versions, #3/711)
  94. * 180 bytes Mon  10-07-1991  10:28:03 (TH @1, shortened, #3/714)
  95. * 181 bytes Fri  10-11-1991  22:47:10 (FD @1, #3/719)
  96. * 160 bytes Sat  10-12-1991  10:03:27 (TH @1, mod to FD #3/719 ver, #3/721)
  97. * 154 bytes Sat  10-12-1991  13:41:13 (TH @1, changed to qsiz.bat,  #3/722)
  98. * 142 bytes Mon  10-14-1991  00:52:50 (FD @1, #3/723)
  99. * 149 bytes Tue  10-15-1991  11:58:48 (TH @1, EnterMatching/Insert On or Off)
  100. * 143 bytes Thu  10-17-1991  10:23:30 (TH @1, changed "c:#.mac" to "c:#.φ"
  101. * 143 bytes Wed  04-15-1992  13:32:13 (TH @1, changed for keys like @[)
  102. * 143 bytes Wed  04-15-1992  13:32:13 (TH @1, to ALL, #3/837)
  103. * 143 bytes Wed  04-15-1992  13:32:13 (TH @1, to NS, #20/566 4/16)
  104. * 146 bytes Wed  04-22-1992  23:31:51 (TH @1, toggle word wrap off)
  105.  
  106. * 
  107. * ----------------------------------------------------------------------
  108. * @(2) Macro To Show Byte Size of ALL Macros in File
  109. * ----------------------------------------------------------------------
  110. *   This macro inserts macro byte size of ALL macros in a file at the
  111. *   end of each macro as shown below.
  112.  
  113. @2  macrobegin setscreenoff onewindow begfile
  114.     setwordwrapmode togglewordwrap                                         *|
  115.   NEXT:
  116.     find "macro" "begin" return "I" return      * Find start of macro
  117.     jfalse END                                  * End if no macro
  118.     splitline endline unmarkblock markcharacter * Mark key                 *|
  119.     prevposition joinline begline               *  "    "                  *|
  120.     storescrbuff "7" return                     * Store <key> to buff 7
  121.     endpara markline                            * Mark macro               *|
  122.     writeblock "c:#" return                     * Write macro block to c:# *|
  123.     "o" backspace                               * In case c:# exists       *|
  124.     dos "qsiz" return return                    * Make macfile Dir list c:¡
  125.     editfile backspace #173 return quit         * Quit c:¡
  126.     gotoblockend                                * Ensure correct ring pos
  127.     editfile return                             * Load macfile Dir list
  128.     find #237 return delline return jfalse END  * Pos cursor on macfile ext
  129.     wordright markword                          * Mark size
  130.     storescrbuff "8" return                     * Store size to buff 8
  131.     killfile quit                               * Kill/quit c:¡            *|
  132.     addline begline                             * Add size line to macro   *|
  133.     "*" cursorright getscrbuff "8" return       * Insert byte size
  134.     endline cursorright "bytes"
  135.     cursorright insertdate inserttime           * Date stamp
  136.     "(TH "                                      * Change to your initials
  137.     getscrbuff "7" return gotoblockend          * Insert key
  138.     endline jtrue END                           * Test if Enter Matching On
  139.     ")" cursorleft                              *ELSE Insert ")"  if not On
  140.     jump NEXT                                   * Loop until no more macros
  141.   END: togglewordwrap unmarkblock                                          *|
  142. *
  143. * 200 bytes Thu  09-13-1990  19:13:19
  144. * 176 bytes Mon  10-07-1991  10:50:13 (TH @2, for all DOS versions, #3/714)
  145. * 150 bytes Tue  10-15-1991  11:59:41 (TH @2, EnterMatching/Insert On or Off)
  146. * 144 bytes Thu  10-17-1991  11:23:01 (TH @2, changed "c:#.mac" to "c:#.φ"
  147. * 144 bytes Wed  04-15-1992  13:49:32 (TH @2, changed for keys like @[)
  148. * 147 bytes Wed  04-22-1992  23:34:18 (TH @2, toggle word wrap off)
  149.  
  150. * 
  151. * ----------------------------------------------------------------------
  152. * @(3) Macro to Show Byte Size of SINGLE Macro In Short Format:
  153. *      * 223 bytes  4/22/92  11:38 pm (TH @3)
  154. * ----------------------------------------------------------------------
  155. *   This macro inserts macro byte size of a SINGLE macro at the end of
  156. *   the macro as shown below in a shorter format than @1, as shown
  157. *   above.  Place cursor line anywhere in a txtfile macro and press @3.
  158.  
  159. *   The data file $time must exist in the current directory.  Change
  160. *   $time to d:\path\$time to execute in any directory.
  161.  
  162. *   ┌─────────────────────────────────────────────────────────────────────┐
  163. *   │$time                                                                │
  164. *   │01 1 am 02  2 am 03  3 am 04  4 am 05 5 am 06  6 am 07  7 am 08  8 am│
  165. *   │09 9 am 10 10 am 11 11 am 12 12 pm 13 1 pm 14  2 pm 15  3 pm 16  4 pm│
  166. *   │17 5 pm 18  6 pm 19  7 pm 20  8 pm 21 9 pm 22 10 pm 23 11 pm 00 12 am│
  167. *   └─────────────────────────────────────────────────────────────────────┘
  168.  
  169. @3  macrobegin setscreenoff onewindow endline
  170.     setwordwrapmode togglewordwrap                                         *|
  171. * ------------ Get Macro Key and Size To Scratch Buffers ------------*
  172.     find "macro" "begin" return "BI" return     * Find start of macro
  173.     jfalse END                                  * End if no macro
  174.     splitline endline unmarkblock markcharacter * Mark key
  175.     prevposition joinline begline               *  "    "
  176.     storescrbuff "7" return                     * Store <key> to buff 7
  177.     endpara markline                            * Mark macro
  178.     writeblock "c:#" return                     * Write macro block to c:#
  179.     "o" backspace                               * In case c:# exists
  180.     dos "qsiz" return return                    * Make macfile Dir list c:¡
  181.     editfile backspace #173 return quit         * Quit c:¡
  182.     gotoblockend                                * Ensure correct ring pos
  183.     editfile return                             * Load macfile Dir list
  184.     find #237 return delline return jfalse END  * Pos cursor on macfile ext
  185.     wordright markword                          * Mark size
  186.     storescrbuff "8" return                     * Store size to buff 8
  187.     killfile quit                               * Kill/quit c:¡
  188. * ---------------------- Insert Macro Byte Size ----------------------*
  189.     addline begline                             * Add size line to macro
  190.     "*" cursorright getscrbuff "8" return       * Insert byte size
  191.     endline cursorright "bytes" cursorright
  192. * ------------------- Insertdate in format 4/15/92 -------------------*
  193.     cursorright defaultwordset
  194.     insertdate prevposition delrtword           * Del day name
  195.     unmarkblock markcolumn
  196.     findreplace "0" return delline return "ln" return * Remove leading zeros
  197.     wordright repeatfind
  198.     backspace "/" wordright backspace "/"       * Delete dashes
  199.     delch delch                                 * Delete "19"
  200.     markword gotoblockend cursorright           * Pos 2 spcs right
  201. * ------------------- Insert Time in format 2:19 pm ------------------*
  202.     cursorright splitline
  203.     inserttime delltword delltword delltword    * Delete ":secs "
  204.     wordleft wordleft markword cut              * Cut 24 hour # to scrap
  205.     onewindow horizontalwindow                  * Setup window for $time
  206.     editfile "$time" return                     * Load data file
  207.     find paste return delline return            * Find 24 hour #
  208.     wordright markcolumn wordright cursorright  * Mark 12 hour and am/pm
  209.     copy quit prevwindow onewindow paste        * Copy/quit/paste data
  210.     wordright markword cursorleft markcolumn    * Mark " am/pm"
  211.     endline moveblock                           * Move it where it belongs
  212.     endline cursorright joinline                * Clean up and pos cursor
  213. * ------------------ Insert Author Initials and Key ------------------*
  214.     "(TH "                                      * Change to your initials
  215.     getscrbuff "7" return gotoblockend          * Insert key
  216.     endline jtrue END                           * Test if Enter Matching On
  217.     ")" cursorleft                              *ELSE Insert ")"  if not On
  218.   END: togglewordwrap unmarkblock                                          *|
  219. *
  220. * 220 bytes  4/15/92  2:17 pm (TH @3, to ALL, #3/837)
  221. * 223 bytes  4/22/92  11:38 pm (TH @3, toggle word wrap off)
  222.  
  223. * VERSION HISTORY
  224. *  1.8  - Macros did not work correctly if windows were open or        10/9/91
  225. *         if temp files existed prior to execution.  Corrected.
  226. *       - QEdit v2.15 required.                                       10/10/91
  227. *       - Implemented changes suggested by Fred Drake.                10/12/91
  228. *         Changed batch file name from qmacb.bat to qsiz.bat.
  229. *       - Modified for EnterMatching/Insert On or Off.                10/15/91
  230. *       - Changed qsiz.bat.                                           10/17/91
  231. *       - In AMAC42.ZIP.                                               3/28/92
  232. *  1.9  - Changed @1/2 for keys like @[.                               4/15/92
  233. *       - Added @3.                                                    4/15/92
  234. *       - Modified @1/2/3 to toggle Word Wrap OFF.                     4/22/92
  235. *
  236. *
  237. *
  238. *
  239. *
  240. *--eof
  241.